Passed
Push — feature/node-16 ( 2d86d4...d617b7 )
by Kevin Van
09:18 queued 03:35
created

TeamSection   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 21
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B render 0 22 5
1
import React, { Component } from "react"
2
import PlayerTeaser from "./PlayerTeaser"
3
4
import "./team--section.scss"
5
6
export class TeamSection extends Component {
7
  render() {
8
    const { title, lineup } = this.props
9
10
    return (
11
      <section className={`team_lineup__section`}>
12
        <h2>{title}</h2>
13
        <ul>
14
          {lineup.map((player, i) => {
15
            return (
16
              <li className={`team_lineup__item`} key={i}>
17
                <PlayerTeaser
18
                  url={player.path.alias}
19
                  position={player.field_shirtnumber || player.field_position_short}
20
                  first_name={player.field_firstname}
21
                  last_name={player.field_lastname}
22
                  picture={player.relationships?.field_image?.localFile?.childImageSharp?.gatsbyImageData}
23
                />
24
              </li>
25
            )
26
          })}
27
        </ul>
28
      </section>
29
    )
30
  }
31
}
32